<?php
require_once 'db.php';
class Keywords extends DB{
    public function select() {
        $this->getConnection();
        $query = 'SELECT * FROM keywords';
        $keywords = $this->query($query);
        return $keywords;
    }
    public function keywords_select1(){
        $this->getConnection();
        $query ='SELECT name ,id
        FROM keywords
        GROUP BY name
        HAVING MAX(LENGTH(name)) >15';
        $keywords = $this->query($query);
        return $keywords;
    }
    public  function select2(){
        $this->getConnection();
        $query = 'SELECT * FROM keywords';
        $keywords = $this->query($query);
        foreach ( $keywords as $list_of_keywords):
            if(strlen($list_of_keywords['name'])>=15){
                //echo $list_of_keywords ['id'];
                //echo $list_of_keywords ['name'].'<br>';
            }
        endforeach;
        return $keywords;
    }
}